home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / xpcom / nsDirectoryService.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  6KB  |  176 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *   IBM Corp.
  24.  *
  25.  * Alternatively, the contents of this file may be used under the terms of
  26.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  27.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  28.  * in which case the provisions of the GPL or the LGPL are applicable instead
  29.  * of those above. If you wish to allow use of your version of this file only
  30.  * under the terms of either the GPL or the LGPL, and not to allow others to
  31.  * use your version of this file under the terms of the MPL, indicate your
  32.  * decision by deleting the provisions above and replace them with the notice
  33.  * and other provisions required by the GPL or the LGPL. If you do not delete
  34.  * the provisions above, a recipient may use your version of this file under
  35.  * the terms of any one of the MPL, the GPL or the LGPL.
  36.  *
  37.  * ***** END LICENSE BLOCK ***** */
  38.  
  39. #ifndef nsDirectoryService_h___
  40. #define nsDirectoryService_h___
  41.  
  42. #include "nsIDirectoryService.h"
  43. #include "nsHashtable.h"
  44. #include "nsILocalFile.h"
  45. #include "nsISupportsArray.h"
  46. #include "nsIAtom.h"
  47.  
  48. #define NS_XPCOM_INIT_CURRENT_PROCESS_DIR       "MozBinD"   // Can be used to set NS_XPCOM_CURRENT_PROCESS_DIR
  49.                                                             // CANNOT be used to GET a location
  50. #define NS_DIRECTORY_SERVICE_CID  {0xf00152d0,0xb40b,0x11d3,{0x8c, 0x9c, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74}}
  51.  
  52. class nsDirectoryService : public nsIDirectoryService,
  53.                            public nsIProperties,
  54.                            public nsIDirectoryServiceProvider2
  55. {
  56.   public:
  57.  
  58.   // nsISupports interface
  59.   NS_DECL_ISUPPORTS
  60.  
  61.   NS_DECL_NSIPROPERTIES  
  62.  
  63.   NS_DECL_NSIDIRECTORYSERVICE
  64.  
  65.   NS_DECL_NSIDIRECTORYSERVICEPROVIDER
  66.   
  67.   NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
  68.  
  69.   nsDirectoryService();
  70.    ~nsDirectoryService();
  71.  
  72.   static nsresult RealInit();
  73.   void RegisterCategoryProviders();
  74.  
  75.   static NS_METHOD
  76.   Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
  77.  
  78.   static nsDirectoryService* gService;
  79.  
  80. private:
  81.     nsresult GetCurrentProcessDirectory(nsILocalFile** aFile);
  82.     
  83.     static PRBool PR_CALLBACK ReleaseValues(nsHashKey* key, void* data, void* closure);
  84.     nsSupportsHashtable mHashtable;
  85.     nsCOMPtr<nsISupportsArray> mProviders;
  86.  
  87. public:
  88.     static nsIAtom *sCurrentProcess;
  89.     static nsIAtom *sComponentRegistry;
  90.     static nsIAtom *sComponentDirectory;
  91.     static nsIAtom *sXPTIRegistry;
  92.     static nsIAtom *sGRE_Directory;
  93.     static nsIAtom *sGRE_ComponentDirectory;
  94.     static nsIAtom *sOS_DriveDirectory;
  95.     static nsIAtom *sOS_TemporaryDirectory;
  96.     static nsIAtom *sOS_CurrentProcessDirectory;
  97.     static nsIAtom *sOS_CurrentWorkingDirectory;
  98.     static nsIAtom *sOS_DesktopDirectory;
  99.     static nsIAtom *sOS_HomeDirectory;
  100. #if defined (XP_MACOSX)
  101.     static nsIAtom *sDirectory;
  102.     static nsIAtom *sTrashDirectory;
  103.     static nsIAtom *sStartupDirectory;
  104.     static nsIAtom *sShutdownDirectory;
  105.     static nsIAtom *sAppleMenuDirectory;
  106.     static nsIAtom *sControlPanelDirectory;
  107.     static nsIAtom *sExtensionDirectory;
  108.     static nsIAtom *sFontsDirectory;
  109.     static nsIAtom *sPreferencesDirectory;
  110.     static nsIAtom *sDocumentsDirectory;
  111.     static nsIAtom *sInternetSearchDirectory;
  112.     static nsIAtom *sUserLibDirectory;
  113.     static nsIAtom *sDefaultDownloadDirectory;
  114.     static nsIAtom *sUserDesktopDirectory;
  115.     static nsIAtom *sLocalDesktopDirectory;
  116.     static nsIAtom *sUserApplicationsDirectory;
  117.     static nsIAtom *sLocalApplicationsDirectory;
  118.     static nsIAtom *sUserDocumentsDirectory;
  119.     static nsIAtom *sLocalDocumentsDirectory;
  120.     static nsIAtom *sUserInternetPlugInDirectory;
  121.     static nsIAtom *sLocalInternetPlugInDirectory;
  122.     static nsIAtom *sUserFrameworksDirectory;
  123.     static nsIAtom *sLocalFrameworksDirectory;
  124.     static nsIAtom *sUserPreferencesDirectory;
  125.     static nsIAtom *sLocalPreferencesDirectory;
  126.     static nsIAtom *sPictureDocumentsDirectory;
  127.     static nsIAtom *sMovieDocumentsDirectory;
  128.     static nsIAtom *sMusicDocumentsDirectory;
  129.     static nsIAtom *sInternetSitesDirectory;
  130. #elif defined (XP_WIN) 
  131.     static nsIAtom *sSystemDirectory;
  132.     static nsIAtom *sWindowsDirectory;
  133.     static nsIAtom *sWindowsProgramFiles;
  134.     static nsIAtom *sDesktop;
  135.     static nsIAtom *sPrograms;
  136.     static nsIAtom *sControls;
  137.     static nsIAtom *sPrinters;
  138.     static nsIAtom *sPersonal;
  139.     static nsIAtom *sFavorites;
  140.     static nsIAtom *sStartup;
  141.     static nsIAtom *sRecent;
  142.     static nsIAtom *sSendto;
  143.     static nsIAtom *sBitbucket;
  144.     static nsIAtom *sStartmenu;
  145.     static nsIAtom *sDesktopdirectory;
  146.     static nsIAtom *sDrives;
  147.     static nsIAtom *sNetwork;
  148.     static nsIAtom *sNethood;
  149.     static nsIAtom *sFonts;
  150.     static nsIAtom *sTemplates;
  151.     static nsIAtom *sCommon_Startmenu;
  152.     static nsIAtom *sCommon_Programs;
  153.     static nsIAtom *sCommon_Startup;
  154.     static nsIAtom *sCommon_Desktopdirectory;
  155.     static nsIAtom *sAppdata;
  156.     static nsIAtom *sLocalAppdata;
  157.     static nsIAtom *sPrinthood;
  158.     static nsIAtom *sWinCookiesDirectory;
  159. #elif defined (XP_UNIX)
  160.     static nsIAtom *sLocalDirectory;
  161.     static nsIAtom *sLibDirectory;
  162. #elif defined (XP_OS2)
  163.     static nsIAtom *sSystemDirectory;
  164.     static nsIAtom *sOS2Directory;
  165. #elif defined (XP_BEOS)
  166.     static nsIAtom *sSettingsDirectory;
  167.     static nsIAtom *sSystemDirectory;
  168. #endif
  169.  
  170.  
  171. };
  172.  
  173.  
  174. #endif
  175.  
  176.